package interview;

import java.util.*;

public class Main3 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        String[] input = s.split(" ");
        Arrays.sort(input,(a,b) -> {
            return findnum(a) - findnum(b);
        });
        for(int i = 0; i < input.length; i++){
            if(i != input.length - 1)
                System.out.print(input[i] + " ");
            else
                System.out.print(input[i]);
        }
    }
    public static int findnum(String str){
        char[] ch = str.toCharArray();
        int ans = -1;
        for(int j = 0; j < ch.length; j++){
            if(ch[j] <= '9' && ch[j] >= '1')
            {
                ans = ch[j] - '0';
                break;
            }
        }
        return ans;
    }
}
/*
is2 Thi1s T4est 3a
 */